package com.star.warmwinter;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.star.tool.util.StatusBarUtil;
import com.star.tool.widget.TitleBar;

public class MainActivity extends AppCompatActivity {

    private TitleBar mTitleBar;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        StatusBarUtil.setColor(this,getResources().getColor(R.color.colorAccent),0);

        mTitleBar = (TitleBar)findViewById(R.id.title_bar);
//        mTitleBar.setLeftImg(R.mipmap.icon_back,24,24);
        mTitleBar.setRightText("aaaa");
        mTitleBar.setDefaultBack(true);
        mTitleBar.setRightClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "提交", Toast.LENGTH_SHORT).show();
            }
        });
        mTitleBar.setLeftImg(0);
        mTitleBar.setLeftText("");
        startActivity(new Intent());
    }

    public void aaa(View view) {
        mTitleBar.setLeftVisibility(View.GONE);
        mTitleBar.setRightVisibility(View.GONE);
    }
}
